﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PloobsEngine.Physics.XJigLib;
using PloobsEngine.SceneControl;

namespace PloobsEngine.IA.Locomotion
{
    public class BasicLocomotionAgent : IAgent
    {
        public BasicLocomotionAgent(IObject obj)
        {
            if(!(obj.PhysicObject is CharacterObject))
                throw new Exception ("Physic object must be a character");

            locomotion = new BasicSteering(obj.PhysicObject as CharacterObject);
            this.Obj = obj;
            this.Obj.Agente = this;
        }

        private BasicSteering locomotion = null;

        public BasicSteering Locomotion
        {
            get { return locomotion; }
            set { locomotion = value; }
        }

        #region IAgent Members

        public void Update(Microsoft.Xna.Framework.GameTime gt)
        {
           locomotion.Update(gt);
        }

        public IObject Obj
        {
            get;
            set;
        }

        #endregion
    }
}
